var express = require('express');
var router = express.Router();
const usersController = require('../controller/users')
const multer = require('multer')
var upload = multer({ dest: 'public/uploads/' })

/* GET users listing. */
router.get('/', function(req, res, next) {
  res.send('respond with a resource');
});

router.post('/login', usersController.login)
router.post('/register', usersController.register)
router.get('/verify', usersController.verify)
router.get('/logout', usersController.logout)
router.get('/getUser', usersController.getUser)
router.post('/updatePassword', usersController.updatePassword)
router.get('/createVerify', usersController.createVerify)
router.post('/uploadAvatar',upload.single('file'),usersController.uploadAvatar)

module.exports = router;
